package com.fh.modules.oms.service.impl;

import com.fh.modules.oms.OrderNote;
import com.fh.modules.oms.OrderOperateMan;
import com.fh.modules.oms.OrderStatus;
import com.fh.modules.oms.entity.OmsOrderWechat;
import com.fh.modules.oms.entity.OmsOrderWechatHistory;
import com.fh.modules.oms.mapper.OmsOrderWechatHistoryMapper;
import com.fh.modules.oms.service.IOmsOrderWechatHistoryService;
import org.springframework.stereotype.Service;

import com.fh.common.web.impl.AbstractServiceImpl;

/**
 * @Description: 微信订单操作记录
 * @author： code generator
 * @date：   2019-10-07
 * @version： V1.0
 */
@Service
public class OmsOrderWechatHistoryServiceImpl extends AbstractServiceImpl<OmsOrderWechatHistoryMapper, OmsOrderWechatHistory> implements IOmsOrderWechatHistoryService {

    @Override
    public void saveWechatHistory(OmsOrderWechat omsOrderWechat, OrderOperateMan orderOperateMan, OrderNote orderNote, OrderStatus targetState) {
        OmsOrderWechatHistory omsOrderWechatHistory = new OmsOrderWechatHistory();
        omsOrderWechatHistory.setMemberId(omsOrderWechat.getMemberId());
        omsOrderWechatHistory.setOperateMan(orderOperateMan.getValue());
        omsOrderWechatHistory.setOrderId(omsOrderWechat.getId());
        omsOrderWechatHistory.setNote(orderNote.getValue());
        omsOrderWechatHistory.setOrderStatus(targetState.getValue());
        this.save(omsOrderWechatHistory);
    }
}
